Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Record locking in Progress

When you read records from a database table, Progress applies a level of locking to the record that you can control so that you can prevent conflicts where multiple users of the same data are trying to read or modify the same records at the same time. This locking doesn’t apply to temp-tables since they are strictly local to a single Progress session and never shared between sessions.

When you read records using a FIND statement, a FOR EACH block, or the GET statement on a query that isn’t being viewed in a browse, by default Progress reads each record with a SHARE-LOCK. The SHARE-LOCK means that Progress marks the record in the database to indicate that your session is using it. Another user (and the general term user here and elsewhere means code in any type of OpenEdge session that is accessing data, whether it’s through an actual user interface or not) can also read the same record in the same way—that’s why this is called a SHARE-LOCK.

You can also specify a keyword on your FIND or FOR EACH statement, or on the OPEN QUERY statement for a query, to read records with a different lock level. If you intend to change a record, you can use the EXCLUSIVE-LOCK keyword. This marks the record as being reserved for your session’s exclusive use where any changes are concerned, including deleting the record. If any other user has a SHARE-LOCK on the record, an attempt to read it with an EXCLUSIVE-LOCK fails. Thus, a SHARE-LOCK assures you that while others can read the same record you have read, they cannot change it out from under you.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095